package cn.tedu.controller;

import java.text.SimpleDateFormat;

import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.bind.annotation.InitBinder;

public abstract class BaseController {

    @InitBinder
    public void InitBinder(ServletRequestDataBinder binder) {
        //注册自定义的编辑器
        binder.registerCustomEditor(java.util.Date.class,
                new CustomDateEditor(
                        new SimpleDateFormat("yyyy-MM-dd"), true));
        //后面的true代表的是 允许为null  false 不允许null
    }


}

